<script>
	import { useStore } from 'vuex';
	
	export default {
		onLaunch: function() {
			const store = useStore()
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			// #ifdef MP-WEIXIN
				this.getHeight()
			// #endif
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods:{
			getHeight(){
				const store = useStore()
				let statusBarHeight = uni.getSystemInfoSync().statusBarHeight,
				customHeight = wx.getMenuButtonBoundingClientRect(),
				navigationBarHeight = customHeight.height + (customHeight.top - statusBarHeight) * 2 
				statusBarHeight = `${navigationBarHeight + statusBarHeight - 5}`
				// console.log('statusBarHeight:'+statusBarHeight)
				store.commit('SET_STATUSBARHEIGHT',statusBarHeight)
			}
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-plus/index.scss";
	
	/*每个页面公共css */
	page{
		/* 字母/数字 换行 */
		word-break:break-all;
		word-wrap:break-word;
		background: #f5f5f5;
	}
	image{
		max-width: 100%;
		max-height: 100%;
	}
	button {
	    border: none;
	}
	// view 点击效果
	.custom_hover{
		background: #f1f1f1 !important;
	}
	.cancel_hover{
		background: #fbdcdc !important;
	}
	.confirm_hover{
		background: #da4239 !important;
	}
	// 文字超出一行显示省略号
	.ellipsis {
	  overflow: hidden;
	  text-overflow:ellipsis;
	  white-space: nowrap;	
	}
	// 文字超出两行显示省略号
	.ellipsis-multiline {
	  display: -webkit-box;
	  -webkit-box-orient: vertical;
	  -webkit-line-clamp: 2; /* 定义文本的行数 */
	  overflow: hidden;
	  text-overflow: ellipsis;
	}
	// 底部按钮
	.footer_btn_wrap{
		height: 128rpx;
		box-sizing: border-box;
		&.fixed{
			position: fixed;
			bottom: 0rpx;
			width: 100%;
		}
		.btn_wrap{
			height: 100%;
			align-items: center;
			display: flex;
			padding: 0 40rpx;
			.btn{
				width: 100%;
				border-radius: 108rpx;
				background: #F5564D !important;
				font-size: 32rpx  !important;;
				color: #fff !important;;
			}
		}
	}
	// 按钮禁止点击
	.btn_disable{
		opacity: 0.7 !important;
	}
	
	.flex{
		display: flex;
	}
	.vertical{
		align-items: center;
	}
	.center{
		justify-content: center;
	}
	
	
	.orange{
		color: #FF8D1A;
	}
	.red{
		color: #C60C0C !important;
	}
	.green{
		color: #00AD82;
	}
	.bold{
		font-weight: bold !important;
	}
	.safe-area-inset-bottom{
		height: constant(safe-area-inset-bottom);
		height: env(safe-area-inset-bottom);
	}
</style>
